/**
 * File Name	: Countdown.h
 * Location		: /Core/
 * Lib.Name		: Core.a
 * Designer		: AS (18-03-07)
 * Mod. 1 by	: AS (18-03-07)
 */

#include "stdafx.h"
#include "Countdown.h"

namespace Core
{
	Countdown::Countdown(unsigned short p_CountdownTime)
		: m_CountdownTime(p_CountdownTime)
	{

	}

	Countdown::~Countdown()
	{

	}

	void Countdown::SetCountdownTime(unsigned short p_CountdownTime)
	{
		m_CountdownTime = p_CountdownTime;
	}

	void Countdown::Start()
	{
		m_StartTime = DateTime();
	}

	bool Countdown::IsFinished()
	{
		DateTime t_Now = DateTime();
		DateTime t_Delta = t_Now.Delta(m_StartTime);
		DateTime t_Minimum((unsigned long)(m_CountdownTime/1000));
		if (t_Delta >= t_Minimum)
		{
			return true;
		}
		return false;
	}
}
